package uk.ac.cam.cl.projectcharlie2010.physicalboard;

import ch.nostromo.tiffanys.game.move.Move;

public class PhysicalBoardControllerTester implements PhysicalBoardControllerListener {
	public static void main(String[] args) {
		PhysicalMoveCalculator moveCalculator = new PhysicalMoveCalculator(new PhysicalBoardControllerTester(), "COM4");
		PhysicalMoveCalculator.LOG_LEVEL = 2;
		
		// Black en passant
//		 String from = "f4";
//		 String to = "e3";
//		 // Knight = 128, Pawn = 512
//		 int piece = 512;
//		 int promotion = 0;
//		 boolean isCastlingShort = false;
//		 boolean isCastlingLong = false;
//		 boolean isStrikeMove = false;
//		 String FEN = "rnbqkbnr/pppppppp/8/8/4Pp2/8/P3PPPP/RNBQKBNR b KQkq e3 0 0";
		
		// White knight
//		 String from = "g1";
//		 String to = "h3";
//		 // Knight = 128, Pawn = 512
//		 int piece = 128;
//		 int promotion = 0;
//		 boolean isCastlingShort = false;
//		 boolean isCastlingLong = false;
//		 boolean isStrikeMove = false;
//		 String FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 0";
		
		// Black king-side castle
//		 String from = "a4";
//		 String to = "b3";
//		 // Knight = 128, Pawn = 512
//		 int piece = 512;
//		 int promotion = 0;
//		 boolean isCastlingShort = true;
//		 boolean isCastlingLong = false;
//		 boolean isStrikeMove = false;
//		 String FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b KQkq - 0 0";
		
		// White queen-side castle
		// String from = "a4";
		// String to = "b3";
		// // Knight = 128, Pawn = 512
		// int piece = 512;
		// int promotion = 0;
		// boolean isCastlingShort = false;
		// boolean isCastlingLong = true;
		// boolean isStrikeMove = false;
		// String FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 0";
		
		// Black queen-side castle; involves change-side
//		String from = "e8";
//		String to = "c8";
//		// Knight = 128, Pawn = 512
//		int piece = 512;
//		int promotion = 0;
//		boolean isCastlingShort = false;
//		boolean isCastlingLong = true;
//		boolean isStrikeMove = false;
//		String FEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR b KQkq - 0 0";
		
		// Black rook move; involves intial change-side
		 String from = "h8";
		 String to = "h7";
		 // Knight = 128, Pawn = 512
		 int piece = 512;
		 int promotion = 0;
		 boolean isCastlingShort = false;
		 boolean isCastlingLong = false;
		 boolean isStrikeMove = true;
		 String FEN = "4kbnr/4q1P1/8/8/8/8/3P1PPP/3QKBNR b KQkq f6 0 0";
		
		PhysicalMoveCalculator.log("Creating Move: from = " + from + ", to = " + to + ", piece = " + piece + ", promotion = " + promotion + ", isCastlingShort = "
				+ isCastlingShort + ", isCastlingLong = " + isCastlingLong + ", isStrikeMove = " + isStrikeMove, 0);
		Move testMove = new Move(from, to, piece, promotion, false, 0, 0, null, isCastlingShort, isCastlingLong, isStrikeMove, false, false);
		
		PhysicalMoveCalculator.log("Using FEN String: " + FEN + "\n", 0);
		moveCalculator.executePhysicalMove(testMove, FEN);
	}

	@Override
	public void executePhysicalMoveFinished() {
		PhysicalMoveCalculator.log("Move Completed!", 0);
	}
}
